﻿function format(str) {
    for (var i = 1; i < arguments.length; i++) {
        str = str.replace('{' + (i - 1) + '}', arguments[i]);
    }
    return str;
}

String.prototype.trim = function () {
    return (this.replace(/^[\s\xA0]+/, "").replace(/[\s\xA0]+$/, ""))
}

String.prototype.endsWith = function (str) {
    return (this.match(str + "$") == str);
}

String.prototype.startsWith = function (str) {
    return (this.match("^" + str) == str);
}
